﻿@using System.ComponentModel.DataAnnotations
@inherits ValidateBase<string>

<BootstrapInput @bind-Value="Value" ShowLabel="ShowLabel"  DisplayText="@DisplayText" ValidateRules="_validateRules"></BootstrapInput>

@code {
    private readonly List<IValidator> _validateRules = new();

   

    protected override void OnParametersSet()
    {
        base.OnParametersSet();
        var required = Required;

        if (!string.IsNullOrEmpty(required))
        {
            _validateRules.Add(new FormItemValidator(new RequiredAttribute()));
        }
    }

}
